#ifndef NODES_H
#define NODES_H

#include <iostream>
#include <climits>
#include <cstdlib>
#include <mpi.h>
#include <sys/time.h>
#include "Body.h"

#ifndef DEBUG
#define DEBUG 0
#endif 

#ifndef RUNTIME_MEASUREMENT
#define RUNTIME_MEASUREMENT 0
#endif

typedef struct timeval timeVal;

void usage();
void distributeWork(int nodes,int bodys,int *workload);

/* doWork() - return: runtime if rank == 0*/
unsigned long doWork(int rank,int size,int steps,int work,int bodys,Body *nBodys);
unsigned long doWorkOnSingleNode(int Steps,int size,Body *nBodys);

/* calcRuntime() - return: runtime <usec.> [end - start] */
unsigned long calcRuntime(timeVal start, timeVal end);

#endif
